const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 100; i++) content.push({
        id: `id${i}`,
        code: `513200${i}`,
        name: `name${i}`,
        shortCode: `123${i}`,
        shortName: `shortName${i}`,
        country: '中国',
        province: '重庆市',
        city: '重庆',
        contactNumber: '12580',
        address: '东和春天',
        agentKind: 20,
        rowVersion: 'string',
        options: [
            'update',
            'abandon'
        ]
    });

    res.json({
        message: 'ok',
        payload: {
            content,
            totalElements: 40,
        }
    });
});

router.get('/forSaleProformaInvoice', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            currency: 1,
            tradeMethodId: '001',
            tradeMethodName: '贸易方式1',
            salesOrderPriceTerms: 1,
            paymentType: 1,
            account: 'account',
            carrierId: 'cc001',
            carrierCode: 'carrierCode',
            carrierName: 'carrierName',
            shippingPortId: 'ss001',
            shippingPortCode: 'shippingPortCode',
            shippingPortName: 'shippingPortName',
            destinationPort: 'destinationPort',
            batchNumber: '131546'
        }
    });
});

router.get('/forSubPiKd', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            currency: 1,
            tradeMethodId: '001',
            tradeMethodName: '贸易方式1',
            salesOrderPriceTerms: 1,
            paymentType: 1,
            account: 'account',
            carrierId: 'cc001',
            carrierCode: 'carrierCode',
            carrierName: 'carrierName',
            shippingPortId: 'ss001',
            shippingPortCode: 'shippingPortCode',
            shippingPortName: 'shippingPortName',
            destinationPort: 'destinationPort',
            batchNumber: '131546',
            model: 'model111'
        }
    });
});

router.get('/:id', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            id: '001',
            code: '513200001',
            name: 'dealerName001',
            shortCode: '123001',
            shortName: 'shortName001',
            agentKind: 20,
            area: '东亚大区',
            country: '中国',
            province: '重庆市',
            city: '重庆',
            contactNumber: '12580',
            fax: '12354532',
            address: '东和春天',
            zipCode: '404000',
            options: [
                'update',
                'abandon'
            ],
            rowVersion: 'string',
            dealerSaleInformationDetails: [
                {
                    id: 'id001',
                    brandId: 'de872f12',
                    brandCode: 'code001',
                    brandName: 'brandName001',
                    tradeMethodId: '26e30b7b',
                    tradeMethodCode: 'tradeMethodCode001',
                    tradeMethodName: 'tradeMethodName001',
                    kdPackingAttribute: 'kdPackingAttribute001',
                    pdIExpenseStandard: 'pdIExpenseStandard001',
                    priceClause: 1,
                    currency: 1,
                    remark: 'remark001',
                    effectiveDate: '2020-01-08T07:58:21.810Z',
                    expirationDate: '2020-01-08T07:58:21.810Z',
                    status: 1,
                    abandonerName: 'abandonerName001',
                    abandonTime: '2020-01-08T07:58:21.811Z',
                    orderType: 1,
                    transportType: 1,
                    paymentType: 1,
                    account: 'account',
                    carrierId: '001',
                    carrierName: 'carrierName',
                    shippingPortId: 'shippingPortId001',
                    shippingPortName: 'shippingPortName',
                    destinationPort: 'destinationPort',
                    deliveryDate: '2020-04-10T07:17:46.411Z'
                },
            ]
        },
        totalElements: 40,
    });
});

router.put('/:id', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});

module.exports = router;

